package com.example.springbean.pkg;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
//@EnableScheduling
public class Scheduler {

    private static final Logger log = LoggerFactory.getLogger(Scheduler.class);


    @Scheduled(initialDelay = 5000, fixedRate = 2000)
    public void test() {
        log.info("{}",Thread.currentThread().getName());
        System.out.println("ceshi");
    }

    @Scheduled(initialDelay = 5000, fixedRate = 2000)
    public void test2() {
        log.info("{}",Thread.currentThread().getName());
        System.out.println("ceshi");
    }
}
